package main

import (
    "fmt"
    "strings"
)

func solution(s string) int {
    // PLEASE DO NOT MODIFY THE FUNCTION SIGNATURE
    // write code here

    // Convert string to lowercase and count characters
    charDict := make(map[rune]int)
    lowerStr := strings.ToLower(s)

    for _, c := range lowerStr {
        charDict[c]++
    }

    kNum := charDict['k']
    uNum := charDict['u']

    return min(kNum, uNum)
}

func min(a, b int) int {
    if a < b {
        return a
    }
    return b
}

func main() {
    fmt.Println(solution("AUBTMKAxfuu") == 1)
    fmt.Println(solution("KKuuUuUuKKKKkkkkKK") == 6)
    fmt.Println(solution("abcdefgh") == 0)
}